package com.gitee.yannzh.rune.example.crud;

import com.gitee.yannzh.rune.support.crud.register.AutoCrudHandlerRegister;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;


@Slf4j
@SpringBootApplication
public class CrudExampleApplication {

    public static void main(String[] args) {
        SpringApplication.run(CrudExampleApplication.class, args);
    }

    @Bean
    public AutoCrudHandlerRegister handlerRegister(RequestMappingHandlerMapping handlerMapping, ApplicationContext applicationContext){
        return new AutoCrudHandlerRegister(handlerMapping,applicationContext);
    }
}
